//
//  SingletonTemplate.h
//  PatientNew
//
//  Created by xxx on 14-7-11.
//  Copyright (c) 2014年 wtf. All rights reserved.
//
//  singleton template for ARC
//

#ifndef PatientNew_SingletonTemplate_h
#define PatientNew_SingletonTemplate_h

// header
#define SYNTHESIZE_SINGLETON_FOR_HEADER(className) \
\
+ (className *)sharedInstance;

// implementation
#define SYNTHESIZE_SINGLETON_FOR_IMPL(className) \
\
+ (className *)sharedInstance { \
    static className *sharedInstance = nil; \
    static dispatch_once_t onceToken; \
    dispatch_once(&onceToken, ^{ \
        sharedInstance = [[self alloc] init]; \
    }); \
    return sharedInstance; \
}

#endif
